import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:jump_scape/js_ui/js_widget/js_style.dart';

jsShowDeleteAccountDialog(
  BuildContext context,
  Function(bool isDelete) onTap,
) {
  showDialog(
    context: context,
    barrierDismissible: false,
    useSafeArea: false,
    barrierColor: Colors.black.withOpacity(0.55),
    builder: ((context) {
      return Column(
        mainAxisAlignment: MainAxisAlignment.end,
        children: [
          Dialog(
            alignment: Alignment.bottomCenter,
            backgroundColor: Colors.transparent,
            insetPadding: EdgeInsets.zero,
            child: Container(
              width: double.infinity,
              // padding: EdgeInsets.only(bottom: ScreenUtil().bottomBarHeight),
              alignment: Alignment.bottomCenter,
              decoration: jsShapeRound(radius: 26.r, color: Colors.white),
              child: Column(
                children: [
                  InkWell(
                    child: Container(
                      width: double.infinity,
                      height: 93.r,
                      alignment: Alignment.center,
                      child: Text('Tap to confirm account deletion', style: jsTextStyle(font: JsTextFont.October_Devanagari_Regular, fontColor: Colors.black, fontSize: 20.r)),
                    ),
                    onTap: () {
                      if (Navigator.canPop(context)) {
                        Navigator.pop(context);
                      }
                      onTap(true);
                    },
                  ),
                  Container(width: double.infinity, height: 0.6.r, margin: EdgeInsets.symmetric(horizontal: 24.r), color: Color(0xFFCCCCCC).withOpacity(0.6)),
                  InkWell(
                    child: Container(
                      width: double.infinity,
                      height: 93.r,
                      alignment: Alignment.center,
                      child: Text('Cancel', style: jsTextStyle(font: JsTextFont.October_Devanagari_Regular, fontColor: Colors.black, fontSize: 20.r)),
                    ),
                    onTap: () {
                      if (Navigator.canPop(context)) {
                        Navigator.pop(context);
                      }
                      onTap(false);
                    },
                  )
                ],
              ),
            ),
          )
        ],
      );
    }),
  );
}
